package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000118620704";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCk/WgLX4Ug6iAF1EZ0Rj50oVDwHKSlr2SUqyvYCn833HOxtHl5pmb7tJLrpY1AFIlJfYQ1FlVwtGTaWzqZP8r3NG35VsD5n/MD3lThAG9z3qUAtcmnfT1RU9WgRyltNmB5fZaKmnu1NtiNh8pIELX2MwYqbrt2oE7Jj6mKy1SBN0QXWb8ccyYQAkqAcpFVl6pdu7NyHEf6g4pPn+DYgaM55cdOjbHnv1WBP0DbLwBTws6hokMnd78NHjaU9RGuVrUfhLuMVVaGA5A1KtKL7NVHorsMCqpSlWTtU/zagAQDRYvXLIkckJTwhyfMDIKvj0oU0iBQAXODCKcu8BaV+vi3AgMBAAECggEAWkxGUVMp7WW1uPsAxEpdjD9tqLxEcFmZ1rQH/ulfzxbcSvnXMfkci828SzQEJnoW2R3U6akbgd95AvjDDXSYhMsxFTGh0/zyZ7+a/LncRbIo5EaZ4wzsLkKPvHS1+4uzKUrOxXTfF8K4ql0THHXo4KH0UezgtH/wHuh9hfTafwz4lH9/Gk3HdCryPc8RyAYJ1EOOfJ/eBQi2Ou6/IZWC8PQbGlRAl0CnvknumfKZBwhw6WiGvoOpBZXds2KEKnoZIuFxyScV6JBhGMXJF2rrkv+fcuHmT1YIk8AkUzPMgDOaH/uYBkqHFGZfrrSxrOX7fHqu+k7TRcEGe+8S+BpdIQKBgQDv3A+k0Gxm4wuXHP2XukLfLorLDLREJhv2U1N+Eqd+Gvzk3Li01s82SbTE/UZ3L8ZqdWPFVWEbxn1njTxrD5dXC4yFLpA2/PUrIgEiVzwjkOeZwiACxil3XDlFQFzezfSM6DGV5sAgiMKP6sFFnFD282XwXD5ro1jhV7W+13p2PQKBgQCwF5o+Muzls/vhJblwUgwCPTox90aJWPedGGI9XwN6+pod+xJ9tkkd4fee7Q8y0y5wNRWFvFEcFj7N/lO7oAts1LcAXIH0K/hB5OSHbdhxF+r9TIiUaWr8itjTRVhy3KRfCGfALfHu3DWeYa03aTxhcdR7LAw/e7vnjOdFyulOAwKBgBBhuz/KbFzqjNQZSsieFAsiJqCPkZBF+grszfsCUyYtua/30zWmpihTCGGb2sAxJyAGPHYxypwXBmGYJ9Q4EGIFi+dcssTOqf/0Jpet1ZGoR+kcdQs7dYGNbuvn5W/iKR2mjhxq0hxmusMRiXmzn2P+Y6vy4OCBG4TodKVAGkERAoGAFirCdfX/MGNZ39vZ3jPV4ypF+yg/ruaONS5un38odwC5CfEjQMQDrElX3J/G/ATtoZ5tGSq9oyWBvni3nbTl+0tDxj3e9hfa5qCjzBCd4I68PCq4PsaOe0AXT3E5UyxHXNc4CE9AV2tNLKTrI0CSI0orD15aJFu1Kc7pBjYm7HUCgYARue45HNr842QKoUyyeQsSXjBhnhI1bWtu/+Vq3pEluxptlwCNfovSGXC7vLEE8o5mEAaxZqK1Cx/x1xkYc9KRC2zszHXaBS32tGntuBpNDIoi0Z4gSj193oIh1A01YZll9bABFfklwC9MgxE2VE/dIKAgX/Z32Kmt4BG3wLccgg==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApj5SGRCoc5RlPg3Hrj50r5AsGTqqVAP3m68gBdTcLBLpJRLRByKd3GxhjkXuOFxUXVXy0X2JoynibdKKzyPuccGCOkLbBa+kYcFBmMlTzMeITCO73YHaQFM6yu44zN2ZCzGl88wCdBZbxzaWiKnZMlDM0E6owNbte5Z9qvdRuH2K+2nNcZk/wxt3FnCzuw5wiaTOVp7d4+Wl99yo9vYiCzN4xZRhp8/w2oEX0W0CeKzVHFlgO+GuZNROg+g8EXwhjrYeTc+OLl1usJNdQ3S3bPn93ATscbRA6IM/AvsMZidXpQNSgvcJdx6CraVLDYlxEK7Qms5DBbY9piB9lhQukwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://9x6qrk.natappfree.cc/notify.do";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://9x6qrk.natappfree.cc/user/index.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

